﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace ThiefRun.States
{
    class TitleState : State
    {
        #region Constants
        // Constants
        const int TITLE_TIME_SEPARATION = 100;
        #endregion Constants

        #region Properties
        // Properties
        SpriteFont titleFont;
        SpriteFont menuFont;
        double menuTime = 0;
        #endregion Properties

        #region Computed Properties
        // Computed Properties
        public double MenuTime { get { return menuTime; } }
        #endregion

        #region Methods
        // Methods

        /// <summary>
        /// Initialize the State Graph.
        /// </summary>
        public TitleState(ThiefRunGame game) : base(game)
        {
            titleFont = game.Content.Load<SpriteFont>("Fonts/Title");
            menuFont = game.Content.Load<SpriteFont>("Fonts/Menu");
        }

        /// <summary>
        /// Draw the current stage.
        /// </summary>
        /// <param name="gameTime"></param>
        /// <param name="spriteBatch"></param>
        public override void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            Vector2 pos = new Vector2(300, 100);
            string time = ((int)menuTime).ToString();

            spriteBatch.Begin();
                spriteBatch.DrawString(titleFont, "Thief Run", pos, Color.White);
            
                pos.Y += TITLE_TIME_SEPARATION;
                spriteBatch.DrawString(menuFont, time, pos, Color.Yellow);
            spriteBatch.End();
        }

        /// <summary>
        /// Perform the actions of the current stage.
        /// </summary>
        /// <param name="gameTime"></param>
        public override void Update(GameTime gameTime)
        {
            menuTime -= gameTime.ElapsedGameTime.TotalSeconds;
            base.Update(gameTime);
        }
        #endregion Methods
    }
}
